package cn.tedu.csmall.order.mapper;



import cn.tedu.csmall.commons.pojo.order.model.OrderTb;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper {
    // 新增订单的Mapper方法
    @Insert("insert into order_tbl(user_id,commodity_code,count,money) " +
            "values(#{userId},#{commodityCode},#{count},#{money})")
    int insertOrder(OrderTb order);

    //分页查询订单数据
    @Select("select id,user_id,commodity_code,count,money from order_tbl")
    List<OrderTb> findAllOrders();
}
